package com.fowo.api.service.handleWork;

import com.fowo.api.model.stock.in.StockInApplyInBatchStorageAction;
import com.fowo.api.model.stock.in.StockInVo;
import com.fowo.api.service.impl.StockInServiceImpl;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Component
public class stockInApplyInBatchStorageAction implements StockInApplyInBatchStorageAction {

    @Resource
    private StockInServiceImpl stockInService;
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void run(List<Long> idList) throws Exception {
        for(int i=0;i<idList.size();i++){
            Long aLong = idList.get(i);
            stockInService.ruku(aLong);
            stockInService.rukucipin(aLong);
        }
    }
}
